package com.gardenguell.salad.app;

import android.app.Activity;
import android.app.Application;
import android.content.pm.ActivityInfo;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by absurd on 2015/11/14.
 */
public class AppContext extends Application {

    private static AppContext mContext;

    private List<Activity> mActivityList = new ArrayList<>();

    @Override
    public void onCreate() {
        super.onCreate();
        mContext = this;
    }

    public static AppContext getContext(){
        return mContext;
    }

    public void addActivity(Activity activity){
        mActivityList.add(activity);
    }

    public void finishAllActivity(){
        for(Activity activity : mActivityList){
            activity.finish();
        }
    }


}
